import Vue from "vue";
import VueRouter from "vue-router";
import Login from "../views/Login.vue";
import Map from "../views/Map.vue";
import NewMap from "../views/NewMap.vue";

Vue.use(VueRouter);

// 导航守卫

const routes = [
  {
    path: "/",
    redirect: "/login",
  },
  {
    path: "/login",
    name: "Login",
    component: Login,
  },
  {
    path: "/map",
    name: "Map",
    component: Map,
  },
  {
    path: "/newmap",
    name: "NewMap",
    component: NewMap,
  },
];

const router = new VueRouter({
  routes,
});

export default router;
